def autoredirection(response):
    try:
        if response.has_header('Location'):
            return response.__getitem__('Location')
        else:
            return ''
    except:
        return ''